/*
============================================================================
FileName	:	main.cpp
Author		:	liyake
Website		:	http://www.liyake.com
Create Data	:	2012-02-27 13:11
Change Data	:	2012-02-27 13:11
Detail		:	The main function of xqchat application
============================================================================
*/

#include <QtGui/QApplication>
#include <QDir>

#include "QXmppClient.h"
#include "QXmppLogger.h"
#include "LoginDialog.h"
#include "MainDialog.h"
#include "XQChatConfiguration.h"

using namespace XQChat;

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);

	QApplication::setOrganizationName("XQChat");
	QApplication::setApplicationName("XQChat");

	QXmppLogger::getLogger()->setLoggingType(QXmppLogger::StdoutLogging);
//	QXmppLogger::getLogger()->setMessageTypes(QXmppLogger::SentMessage);

	if(!XQChat::CXQChatConfiguration::loadClientConfig())
	{
		QMessageBox::warning(0,QObject::tr("load client config file error."),
			QObject::tr("load client config file error, client exit."));
		return -1;
	}
	CMainDialog::getMainDialog();
	CLoginDialog::getLoginDialog()->show();

    return a.exec();
}
